package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.domain.AddressBook;
import com.itheima.dao.AddressBookDao;
import com.itheima.service.AddressBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AddressBookServiceImpl extends ServiceImpl<AddressBookDao, AddressBook> implements AddressBookService {

    @Autowired
    private AddressBookService addressBookService;

    //删除地址
    @Override
    public void deleteAll(Long ids) {
        LambdaUpdateWrapper<AddressBook> wapper = new LambdaUpdateWrapper<>();
        wapper.eq(AddressBook::getId,ids);
        AddressBook one = addressBookService.getOne(wapper);
        addressBookService.remove(wapper);
    }

}